# fledermaus rom format file

# all lines beginning with a hash are ignored

# this file contains information that tells fledermaus how to interpret the
# rom data. changing this file won't change the rom, only how it looks in
# fledermaus.

# this version is "formsv11.txt", used to interpret the v1.1 rom for saga
# (Makai Toushi SaGa) and modified roms based on it. fconfig.txt determines
# which of these format files will be used.

# it shouldn't be necessary to modify this file for most purposes.

####

# file size: expected size of rom.
# size is 0x20000 = 131072, comprising bytes at offsets 0x00000~0x1FFFF.
filesize = 131072

# global checksum byte file positions.
gcb1 = 0x0014E
gcb2 = 0x0014F

####

# labels.
# used by fledermaus to provide context for some data.
# edit to taste.

crtype0 = Aquatic
crtype1 = Ogrish
crtype2 = Draconic
crtype3 = Unholy
crtypen = Neutral
crtypem = Multiple

element0 = Fire
element1 = Ice
element2 = Elec
element3 = Poison
element4 = Stone
element5 = Para
element6 = Weapon
element7 = Quake
elementn = None
elementm = Multiple

status0 = Death
status1 = Stone
status2 = Curse
status3 = Blind
status4 = Poison
status5 = Conf
status6 = Para
status7 = Sleep
statusn = None
statusm = Multiple

race0 = Human
race1 = Esper
race2 = Monster

# room descriptions file.
# use roomname.txt, or create your own version.
roomfile = roomname.txt

####

# font matrix: tells fledermaus how to display the game's character set.

# c = control character of some kind
# f = characters stored in four-colour format (heart, etc)
# 1 = dte set 1 (dual tile encoding)
# 2 = dte set 2
# n = normal text (characters stored in two-colour format: num, kana, symbols)
# b = border character (four-colour)
# d = character with dakuten superscript
# h = character with handakuten superscript

# no comments allowed within matrix.

fontmatrix = :
cccccccccccccccc
cccccccccccccccc
cccccccccccccccc
cccccccccccccccc
ffffffffffffffdd
dddddddddddddddd
dddddddddddddddd
ddddddhhhhhhhhhh
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnn
nnnnnnnbbbbbbbbb

# whether dte or superscription are used.
usesdte = 0
usessuper = 1

# whether character and ability names and other text can be entered with the
# keyboard.
typenames = 0
# this is off for saga because i don't know a good way to map ascii keyboard
# input to saga kana. therefore names can only be entered using the font grid.
# to enable it, you'll first need to make a keysfile and declare it here.
# see formffl.txt for the syntax. and see keysffl.txt for keysfile format.

# character set positions.
heartbase = 0x40
dakuonbase = 0x4E
handakuonbase = 0x76
normalbase = 0x80
borderbase = 0xF7

# dakuten and handakuten characters.
dakuten = 0xF0
handakuten = 0xF1

# dakuon base-character list file positions. (menu/speech)
dbclmpos = 0x00D71
hbclmpos = 0x00D99
dbclspos = 0x00FE7
hbclspos = 0x0100F

# vram tile info.
useshvt = 1
heartvtpos = 0x00DA3
heartvbase = 0x70
crysvbase = 0x60

# other characters.
usedash = 0xF2
space = 0xFF
numbase = 0x80

####

# graphic file positions.
heartpos = 0x0BF00
textpos = 0x0F100
crystalpos = 0x0BE00
borderpos = 0x0F4B8
spicpos = 0x06000
lpicpos = 0x10000
maptilepos = 0x04000
titlepos = 0x0BA00
attackpos = 0x0F650

# title info.
# type 1 = saga-like; 8*2 subtiles, then 12*4 subtiles.
titletype = 1
sagatitle1 = 0x0F600
sagatitle2 = 0x0F610

# attack animation info.
seqaddrpos = 0x1FC00
seqsstart = 0x1FCAC
seqsend = 0x1FFFF
atkxypos = 0x1FC1E
scrdefaddr = 0x1FBA0
scrstart = 0x1FBBE
scrend = 0x1FBDF
tornado = 0x1FB60

# sound file positions.
musicaddr = 0x1C62F
musicstart = 0x1C69B
musicend = 0x1E86F
musicfirst = 0
musiclast = 17
sfxaddr = 0x1EBC7
sfxstart = 0x1EC57
sfxend = 0x1EDFF
sfxfirst = 1
sfxlast = 36

####

# text file positions.
ctAaddrpos = 0x01A1B
ctBaddrpos = 0x01A46
ctCaddrpos = 0x01A40
cheststart = 0x01C11
chestend = 0x01C33
ftextaddr = 0x0B860
ftextstart = 0x0B500
ftextend = 0x0B85F
ftextfirst = 0
ftextlast = 0x4F
mtextaddr = 0x0F080
mtextstart = 0x0EC00
mtextend = 0x0F07F
mtextfirst = 0
mtextlast = 0x32
ngridpos = 0x0F548
cnamepos = 0x14000
anamepos = 0x14640
stextaddr = 0x17B30
stextstart = 0x14E40
stextend = 0x17B2F
stextfirst = 0x010
stextlast = 0x10E
statuspos = 0x17FC0

####

# room-related data file positions.
roomaddr = 0x098D0
roommax = 0xC7
roomstart = 0x09A60
roomend = 0x0A2EF
npcpics = 0x09240
piclistmax = 0x17
npc1start = 0x0985E
npc1end = 0x098CF
npc2start = 0x0A2F0
npc2end = 0x0AFA4
mapstart = 0x0C000
mapend = 0x0EBFF
exitspos = 0x092D0
exitmax = 0x1D9
gsetaddr = 0x08820
gsetstart = 0x08000
ssetstart = 0x08840
ssetmax = 0x27
enclistpos = 0x1A400
enclistmax = 0x8C
encdatapos = 0x1A868
encformpos = 0x1B2C4
encformmax = 0x1E

####

# data and misc file positions.
cdatapos = 0x1AAE8
charmax = 0xC7
adatapos = 0x1B700
abilmax = 0xFF
spidmlpos = 0x0B438
walktiles = 0x02011
lpidpos = 0x0B900
lspecpos = 0x0B9C8
lflavpos = 0x00E6B
meattable = 0x0AFD3
meatlists = 0x0B2A8
flavourmax = 0x1C
eatermax = 0x18
outcomemax = 0x18
smcurspecs = 0x03F0A
crtypepos = 0x1B1F0
movesstart = 0x1B321
movesend = 0x1B6FF
hpvalues = 0x1B254
goldvalues = 0x1B2A4
silvvalues = 0x1B294
itemprices = 0x17E10
daidpos = 0x18E16
shopdata = 0x17D2E
shopfirst = 0x03
shoplast = 0x18
guilddata = 0x17F90
guildfirst = 0xF2
guildlast = 0xF7
mutatefreq = 0x1BF00
mutatevals = 0x1BF0A
mutateabil = 0x1BF0F
creahpvals = 0x1BF50
fightmusic = 0x1F4D7

####

# field-behaviour code file positions.
fcaddr1pos = 0x03731
fcaddr2pos = 0x03761
fca1base = 0x00
fca1max = 0x17
fca2base = 0x80
fca2max = 0x86
fcpotion = 0x03879
fccure = 0x038C7
fcremedy = 0x03921
fclife = 0x03942
fcelixir = 0x0396C
fcheart = 0x039B5
fcrenew = 0x037FA
fcteleport = 0x0376F
fcssource = 0x039D1
fcasource = 0x039D8
fchsource = 0x03A13
fchero1 = 0x03A96
fchero2 = 0x03AA2
fchero3 = 0x03AAE
fcairseed = 0x03B2A
fcorb = 0x03A6D
fceraser = 0x03B35
fcfullcure = 0x039A2

####

# misc code file positions.
mcnewstext = 0x0084A
mcnewguild = 0x0FF3D
mccryssetf = 0x02846
mcfoursetf = 0x02894
mccryspent = 0x02814
mcfourreqf = 0x0283C
mccrystest = 0x02831
mcfourshow = 0x0287E
mccrysshow = 0x02AB5
mccrystext = 0x03B16
mccryssfx = 0x02857
mcfoursfx = 0x02889
mcorbsetf1 = 0x03A85
mcorbsetf2 = 0x03A8C
mcking1set = 0x03A96
mcking2set = 0x03AA2
mcking3set = 0x03AAE
mckingincf = 0x03B04
mcherotest = 0x03B0A
mcherofull = 0x03AF7
mcherosetf = 0x03B0F
mcheroroom = 0x03ABB
mcherotile = 0x03AC3
mcairstext = 0x03B2A
mcerasroom = 0x03B38
mcerastext = 0x03B3D
mcarmradd1 = 0x03624
mcarmradd2 = 0x03628
mcarmradd3 = 0x03603
mcarmradd4 = 0x03607
mcarmradd5 = 0x03699
mchpupbase = 0x03A59
mcvehicpic = 0x02561
mcattrcap = 0x03A10
mchpcap = 0x03A46
mccapwrite = 0x001E3

mcsawfix1 = 0x18A04
mcsawfix2 = 0x189D5
mcsawfix2c = 0x18A29
mcsawfix3 = 0x189F0
mcsawfix3c = 0x180C6
mcsawfix3o = 0x180F8
mcexplfix1 = 0x18EBA
mcexplfix2 = 0x18EC3
mcconffix1 = 0x1999D
mcconffix2 = 0x199A4
mcconffix3 = 0x199A9
mcstrblfix = 0x18553
mcsmdeffix = 0x18C0F
mcwmdeffix = 0x18E78
mcxclypfix = 0x18990
mcxclyfixo = 0x180EE
mcxclyfixc = 0x180F3
mcxclyfixa = 0x180E4
mcmhitefix = 0x18D51
mcebarrfix = 0x1991C
mccoiltfix = 0x18AD2
mcshshdfix = 0x18DCC
mcdrnpcfix = 0x187CB
mcmuqrfix1 = 0x194D3
mcmuqrfix2 = 0x194E1
mcescrate = 0x19ACE
mccritrate = 0x18731
mcstlrate1 = 0x19D3B
mcstlrate2 = 0x19D64
mcsanerate = 0x18345
mcfailrate = 0x18C56
mcwidefail = 0x190D0
mcsthtwork = 0x18DE4
mcsthtdenm = 0x18DF9
mcmrrlimit = 0x19087
mcpoisabil = 0x19149
mcstlabil = 0x19D0E
mcwrnabil1 = 0x19D24
mcwrnabil2 = 0x19D2E
mcwrnabil3 = 0x19D4D
mcwrnabil4 = 0x19D57
mcparaabil = 0x184C6
mcslepabil = 0x184EE
mcforfabil = 0x19A6D
mcesptext = 0x18E64
mcsanetext = 0x18352
mccreaenc = 0x19851
mccrfround = 0x19DD3
mccrfaddr = 0x19DD9
mcfgttypes = 0x005DA

####
